<form method="post" action="/relatorys/result">
	<fieldset class="tableMenu">
		<div>
			<input type="submit" name="generateRelatory" value="Gerar"/>
		</div>
	</fieldset>
	<fieldset class="tableHeader">
	
	<div class="row">
	<?php 	
		$counter = 0;
		//lista as colunas
		foreach($this->table['schema'] as $collumnId => $collumnHeader)
		{
			if(!$counter)
			{
				echo '<div>Relatórios</div>';
			}
			if($collumnHeader['Field'] != 'id')
			{
	?>
		<span><?= $collumnHeader['Field'] ?></span>
	<?php 
			}
			$counter++;
		}
	?>
	</div>
	<fieldset class="tableBody">	
		<div class="row">
	<?php 
		//lista as linhas
		foreach($this->table['content'] as $relatory)
		{
	?>	
			<div class="row">
		<?php 
			$counter = 0;
			
 			//lista as colunas
			foreach($this->table['schema'] as $collumnId => $collumnHeader)
			{
				$element = '<input type="checkbox" name="'.$relatory['name'].'_'.$collumnHeader['Field'].'" />';
				//testa se os tipos nao sao incompatíveis com os relatórios
				if($collumnHeader['Type']=='varchar(255)' && $relatory['integer'])
				{
					$element = '<span>Indispon&iacute;vel</span>';
				}	
				if(!$counter)
				{
					echo '<div ">'.$relatory['name'].'</div>';
				}

				if($collumnHeader['Field'] != 'id')
				{
		?>
				<div class="<?= $class?>">
					<?= $element ?>
				</div>
		<?php
				}
				$counter++;
			}
		?>
			</div>	
	<?php
		}
	?>	</div>
	
	</fieldset>

	<input type="hidden" name="tableInfo" value="project_<?= $this->projectId ?>_table_<?= $this->tableId ?>"/>
</form>